import Vue from "vue";
import App from "./App.vue";
import router from "./router"
import store from './store'
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "./assets/reset.css";
import "./assets/my.css";
import "./assets/customIcon.css"

// 进度条
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
NProgress.configure({
	showSpinner: false
});
//指令
import directive from './directive' // directive
Vue.use(directive)
// 字典数据组件
import dictdata from '@/use/dictdata'
dictdata.install()
//引入所有组件
const myComponents = require.context('./components', true, /\.vue$/);
myComponents.keys().forEach((key) => {
	const component = myComponents(key).default;
	console.info("component", component)
	Vue.component(component.name, component);
})
//引入所有工具类
const myUtils = require.context('./utils', true, /\.js/);
myUtils.keys().forEach((key) => {
	const myUtil = myUtils(key).default;
	if (typeof(myUtil) != 'undefined' && myUtil.hasOwnProperty("name")) {
		Vue.prototype['$' + myUtil.name] = myUtil
	}
})
//引入api
import api from "./api/api.js"
Vue.prototype.$api = api
//使用UI库
Vue.use(ElementUI, {
	size: 'small',
	zIndex: 3000
});

Vue.config.productionTip = false;

const app = new Vue({
	router,
	render: (h) => h(App),
	store,
	mounted() {},
	methods: {}
})
app.$mount("#app");